diff --git a/qcom/pd-mapper/pd-mapper.c b/qcom/pd-mapper/pd-mapper.c
index 664b77d..376d9fe 100644
--- a/qcom/pd-mapper/pd-mapper.c
+++ b/qcom/pd-mapper/pd-mapper.c
@@ -36,6 +36,7 @@
 #include <fcntl.h>
 #include <libgen.h>
 #include <libqrtr.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/qcom/qrtr/Makefile b/qcom/qrtr/Makefile
index f814aa2..036691c 100644
--- a/qcom/qrtr/Makefile
+++ b/qcom/qrtr/Makefile
@@ -126,7 +126,7 @@
 
 $(DESTDIR)$(servicedir)/$1: $1
 	@echo "INSTALL	$$<"
-	@install -D -m 755 $$< $$@
+	@install -D -m 644 $$< $$@
 
 all-install += $(DESTDIR)$(servicedir)/$1
 endef
diff --git a/qcom/qrtr/lib/libqrtr.h b/qcom/qrtr/lib/libqrtr.h
index 87433ed..93254df 100644
--- a/qcom/qrtr/lib/libqrtr.h
+++ b/qcom/qrtr/lib/libqrtr.h
@@ -4,6 +4,7 @@
 #include <linux/qrtr.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <stddef.h>
 #include <stdint.h>
 
 #ifdef __cplusplus
@@ -11,7 +12,7 @@
 #endif
 
 #ifndef offsetof
-#define offsetof(type, md) ((unsigned long)&((type *)0)->md)
+#define offsetof(type, md) ((size_t)&((type *)0)->md)
 #endif
 
 #ifndef container_of
@@ -90,7 +91,7 @@
 	uint32_t elem_size;
 	enum qmi_array_type array_type;
 	uint8_t tlv_type;
-	uint32_t offset;
+	size_t offset;
 	struct qmi_elem_info *ei_array;
 };
 
diff --git a/qcom/qrtr/lib/qmi.c b/qcom/qrtr/lib/qmi.c
index f1c0293..d217a2d 100644
--- a/qcom/qrtr/lib/qmi.c
+++ b/qcom/qrtr/lib/qmi.c
@@ -249,8 +249,8 @@
 			LOGW("%s: STRUCT Encode failure\n", __func__);
 			return rc;
 		}
-		buf_dst = (char*)buf_dst + rc;
-		buf_src = (char*)buf_src + temp_ei->elem_size;
+		buf_dst = (void*)((char*)buf_dst + rc);
+		buf_src = (void*)((char*)buf_src + temp_ei->elem_size);
 		encoded_bytes += rc;
 	}
 
@@ -310,7 +310,7 @@
 		encoded_bytes += rc;
 	}
 
-	rc = qmi_encode_basic_elem((char*)buf_dst + encoded_bytes, buf_src,
+	rc = qmi_encode_basic_elem((void*)((char*)buf_dst + encoded_bytes), buf_src,
 				   string_len, temp_ei->elem_size);
 	encoded_bytes += rc;
 
@@ -354,7 +354,7 @@
 		buf_dst = buf_dst + (TLV_LEN_SIZE + TLV_TYPE_SIZE);
 
 	while (temp_ei->data_type != QMI_EOTI) {
-		buf_src = (char*)in_c_struct + temp_ei->offset;
+		buf_src = (void*)((char*)in_c_struct + temp_ei->offset);
 		tlv_type = temp_ei->tlv_type;
 
 		if (temp_ei->array_type == NO_ARRAY) {
@@ -522,8 +522,8 @@
 				tlv_len - decoded_bytes, dec_level);
 		if (rc < 0)
 			return rc;
-		buf_src = (char*)buf_src + rc;
-		buf_dst = (char*)buf_dst + temp_ei->elem_size;
+		buf_src = (void*)((char*)buf_src + rc);
+		buf_dst = (void*)((char*)buf_dst + temp_ei->elem_size);
 		decoded_bytes += rc;
 	}
 
@@ -585,7 +585,7 @@
 		return -EFAULT;
 	}
 
-	rc = qmi_decode_basic_elem(buf_dst, (char*)buf_src + decoded_bytes,
+	rc = qmi_decode_basic_elem(buf_dst, (void*)((char*)buf_src + decoded_bytes),
 				   string_len, temp_ei->elem_size);
 	*((char *)buf_dst + string_len) = '\0';
 	decoded_bytes += rc;
@@ -654,7 +654,7 @@
 			tlv_pointer = buf_src;
 			QMI_ENCDEC_DECODE_TLV(&tlv_type,
 					      &tlv_len, tlv_pointer);
-			buf_src = (uint8_t*)buf_src + (TLV_TYPE_SIZE + TLV_LEN_SIZE);
+			buf_src = (void*)((char*)buf_src + (TLV_TYPE_SIZE + TLV_LEN_SIZE));
 			decoded_bytes += (TLV_TYPE_SIZE + TLV_LEN_SIZE);
 			temp_ei = find_ei(ei_array, tlv_type);
 			if (!temp_ei && tlv_type < OPTIONAL_TLV_TYPE_START) {
@@ -673,11 +673,11 @@
 			tlv_len = in_buf_len - decoded_bytes;
 		}
 
-		buf_dst = (uint8_t*)out_c_struct + temp_ei->offset;
+		buf_dst = (void*)((char*)out_c_struct + temp_ei->offset);
 		if (temp_ei->data_type == QMI_OPT_FLAG) {
 			memcpy(buf_dst, &opt_flag_value, sizeof(uint8_t));
 			temp_ei = temp_ei + 1;
-			buf_dst = (uint8_t*)out_c_struct + temp_ei->offset;
+			buf_dst = (void*)((char*)out_c_struct + temp_ei->offset);
 		}
 
 		if (temp_ei->data_type == QMI_DATA_LEN) {
@@ -687,7 +687,7 @@
 						   1, data_len_sz);
 			memcpy(buf_dst, &data_len_value, sizeof(uint32_t));
 			temp_ei = temp_ei + 1;
-			buf_dst = (uint8_t*)out_c_struct + temp_ei->offset;
+			buf_dst = (void*)((char*)out_c_struct + temp_ei->offset);
 			tlv_len -= data_len_sz;
 			UPDATE_DECODE_VARIABLES(buf_src, decoded_bytes, rc);
 		}
@@ -777,7 +777,7 @@
 
 	/* Encode message, if we have a message */
 	if (c_struct) {
-		msglen = qmi_encode(ei, (char*)pkt->data + sizeof(*hdr), c_struct,
+		msglen = qmi_encode(ei, (void*)((char*)pkt->data + sizeof(*hdr)), c_struct,
 				    pkt->data_len - sizeof(*hdr), 1);
 		if (msglen < 0)
 			return msglen;
@@ -839,7 +839,7 @@
 	if (txn)
 		*txn = hdr->txn_id;
 
-	return qmi_decode(ei, c_struct, (char*)pkt->data + sizeof(*hdr), pkt->data_len - sizeof(*hdr), 1);
+	return qmi_decode(ei, c_struct, (void*)((char*)pkt->data + sizeof(*hdr)), pkt->data_len - sizeof(*hdr), 1);
 }
 
 /* Common header in all QMI responses */
diff --git a/qcom/qrtr/lib/qrtr.c b/qcom/qrtr/lib/qrtr.c
index 7c1c389..96756ba 100644
--- a/qcom/qrtr/lib/qrtr.c
+++ b/qcom/qrtr/lib/qrtr.c
@@ -52,7 +52,7 @@
 	}
 
 	if (rport != 0) {
-		struct sockaddr_qrtr sq;
+		struct sockaddr_qrtr sq = {};
 
 		sq.sq_family = AF_QIPCRTR;
 		sq.sq_node = 1;
@@ -78,7 +78,7 @@
 
 int qrtr_sendto(int sock, uint32_t node, uint32_t port, const void *data, unsigned int sz)
 {
-	struct sockaddr_qrtr sq;
+	struct sockaddr_qrtr sq = {};
 	int rc;
 
 	sq.sq_family = AF_QIPCRTR;
diff --git a/qcom/qrtr/src/list.h b/qcom/qrtr/src/list.h
index d740743..1d1c8e6 100644
--- a/qcom/qrtr/src/list.h
+++ b/qcom/qrtr/src/list.h
@@ -1,8 +1,10 @@
 #ifndef _LIST_H_
 #define _LIST_H_
 
+#include <stddef.h>
+
 #ifndef offsetof
-#define offsetof(type, md) ((unsigned long)&((type *)0)->md)
+#define offsetof(type, md) ((size_t)&((type *)0)->md)
 #endif
 
 #ifndef container_of
diff --git a/qcom/qrtr/src/lookup.c b/qcom/qrtr/src/lookup.c
index 3312e40..80cf984 100644
--- a/qcom/qrtr/src/lookup.c
+++ b/qcom/qrtr/src/lookup.c
@@ -64,6 +64,7 @@
 	{ 41, 0, "RF radiated performance enhancement service" },
 	{ 42, 0, "Data system determination service" },
 	{ 43, 0, "Subsystem control service" },
+	{ 47, 0, "Data Port Mapper service" },
 	{ 49, 0, "IPA control service" },
 	{ 51, 0, "CoreSight remote tracing service" },
 	{ 52, 0, "Dynamic Heap Memory Sharing" },
@@ -76,6 +77,7 @@
 	{ 312, 0, "QBT1000 Ultrasonic Fingerprint Sensor service" },
 	{ 769, 0, "SLIMbus control service" },
 	{ 771, 0, "Peripheral Access Control Manager service" },
+	{ 4096, 0, "TFTP" },
 	{ DIAG_SERVICE, 0, "DIAG service" },
 };
 
diff --git a/qcom/rmtfs/rmtfs.c b/qcom/rmtfs/rmtfs.c
index 93965f1..b3ed289 100644
--- a/qcom/rmtfs/rmtfs.c
+++ b/qcom/rmtfs/rmtfs.c
@@ -220,6 +220,10 @@
 respond:
 	dbgprintf("[RMTFS] iovec %d, %sforced => (%d:%d)\n", caller_id, force ? "" : "not ",
 							     resp.result.result, resp.result.error);
+
+	if (is_write)
+		storage_sync(rmtfd);
+
 	for (i = 0; i < num_entries; i++) {
 		dbgprintf("[RMTFS]       %s %d:%d 0x%x\n", is_write ? "write" : "read",
 							   entries[i].sector_addr,
@@ -445,7 +449,10 @@
 		rproc_start();
 
 	for (;;) {
-		if (rprocfd >= 0 && sig_int_count == 1 && !sig_int_handled) {
+		if (sig_int_count == 1 && !sig_int_handled) {
+			if (rprocfd < 0)
+				break;
+
 			rproc_stop();
 			sig_int_handled = true;
 		} else if (sig_int_count > 1) {
diff --git a/qcom/rmtfs/rmtfs.h b/qcom/rmtfs/rmtfs.h
index 242baa5..fa4b806 100644
--- a/qcom/rmtfs/rmtfs.h
+++ b/qcom/rmtfs/rmtfs.h
@@ -34,6 +34,7 @@
 void storage_exit(void);
 ssize_t storage_pread(const struct rmtfd *rmtfd, void *buf, size_t nbyte, off_t offset);
 ssize_t storage_pwrite(struct rmtfd *rmtfd, const void *buf, size_t nbyte, off_t offset);
+int storage_sync(struct rmtfd *rmtfd);
 
 int rproc_init(void);
 int rproc_start(void);
diff --git a/qcom/rmtfs/rproc.c b/qcom/rmtfs/rproc.c
index 95b45cb..68dc3c9 100644
--- a/qcom/rmtfs/rproc.c
+++ b/qcom/rmtfs/rproc.c
@@ -13,13 +13,75 @@
 #include "rmtfs.h"
 
 #define RPROC_BASE_PATH		"/sys/bus/platform/drivers/qcom-q6v5-mss/"
+#define RPROC_CLASS_PATH	"/sys/class/remoteproc/"
 
 static pthread_t start_thread;
 static pthread_t stop_thread;
 static int rproc_state_fd;
 static int rproc_pipe[2];
 
-int rproc_init(void)
+static int rproc_init_by_modalias(void)
+{
+	struct dirent *rproc_de;
+	char modalias[256];
+	DIR *base_dir;
+	int modalias_fd;
+	int rproc_fd;
+	int state_fd = -1;
+	int base_fd;
+	int ret;
+
+	base_fd = open(RPROC_CLASS_PATH, O_RDONLY | O_DIRECTORY);
+	if (base_fd < 0)
+		return -1;
+
+	base_dir = fdopendir(base_fd);
+	if (!base_dir) {
+		fprintf(stderr, "failed to open remoteproc class path\n");
+		close(base_fd);
+		return -1;
+	}
+
+	while (state_fd < 0 && (rproc_de = readdir(base_dir)) != NULL) {
+		if (!strcmp(rproc_de->d_name, ".") ||
+		    !strcmp(rproc_de->d_name, ".."))
+			continue;
+
+		rproc_fd = openat(base_fd, rproc_de->d_name, O_RDONLY | O_DIRECTORY);
+		if (rproc_fd < 0)
+			continue;
+
+		modalias_fd = openat(rproc_fd, "device/modalias", O_RDONLY);
+		if (modalias_fd < 0)
+			goto close_rproc_fd;
+
+		ret = read(modalias_fd, modalias, sizeof(modalias) - 1);
+		if (ret < 0)
+			goto close_modalias_fd;
+		modalias[ret] = '\0';
+
+		if (!strstr(modalias, "-mpss-pas") && !strstr(modalias, "-mss-pil"))
+			goto close_modalias_fd;
+
+		state_fd = openat(rproc_fd, "state", O_WRONLY);
+		if (state_fd < 0) {
+			fprintf(stderr,
+				"unable to open remoteproc \"state\" control file of %s\n",
+				rproc_de->d_name);
+		}
+
+close_modalias_fd:
+		close(modalias_fd);
+close_rproc_fd:
+		close(rproc_fd);
+	}
+	closedir(base_dir);
+	close(base_fd);
+
+	return state_fd;
+}
+
+static int rproc_init_by_mss_driver(void)
 {
 	struct dirent *device_de;
 	struct dirent *rproc_de;
@@ -28,10 +90,8 @@
 	DIR *base_dir;
 	int device_fd;
 	int rproc_fd;
+	int state_fd = -1;
 	int base_fd;
-	int ret;
-
-	rproc_state_fd = -1;
 
 	base_fd = open(RPROC_BASE_PATH, O_RDONLY | O_DIRECTORY);
 	if (base_fd < 0)
@@ -44,7 +104,7 @@
 		return -1;
 	}
 
-	while (rproc_state_fd < 0 && (device_de = readdir(base_dir)) != NULL) {
+	while (state_fd < 0 && (device_de = readdir(base_dir)) != NULL) {
 		if (!strcmp(device_de->d_name, ".") ||
 		    !strcmp(device_de->d_name, ".."))
 			continue;
@@ -60,7 +120,7 @@
 		}
 
 		rproc_dir = fdopendir(rproc_base_fd);
-		while (rproc_state_fd < 0 && (rproc_de = readdir(rproc_dir)) != NULL) {
+		while (state_fd < 0 && (rproc_de = readdir(rproc_dir)) != NULL) {
 			if (!strcmp(rproc_de->d_name, ".") ||
 			    !strcmp(rproc_de->d_name, ".."))
 				continue;
@@ -69,8 +129,8 @@
 			if (rproc_fd < 0)
 				continue;
 
-			rproc_state_fd = openat(rproc_fd, "state", O_WRONLY);
-			if (rproc_state_fd < 0) {
+			state_fd = openat(rproc_fd, "state", O_WRONLY);
+			if (state_fd < 0) {
 				fprintf(stderr,
 					"unable to open remoteproc \"state\" control file of %s\n",
 					device_de->d_name);
@@ -86,15 +146,29 @@
 	closedir(base_dir);
 	close(base_fd);
 
-	if (rproc_state_fd < 0)
-		return -1;
+	return state_fd;
+}
+
+int rproc_init(void)
+{
+	int state_fd;
+	int ret;
+
+	state_fd = rproc_init_by_modalias();
+	if (state_fd < 0) {
+		state_fd = rproc_init_by_mss_driver();
+		if (state_fd < 0)
+			return -1;
+	}
 
 	ret = pipe(rproc_pipe);
 	if (ret < 0) {
-		close(rproc_state_fd);
+		close(state_fd);
 		return -1;
 	}
 
+	rproc_state_fd = state_fd;
+
 	return rproc_pipe[0];
 }
 
@@ -103,15 +177,22 @@
 	ssize_t ret;
 
 	ret = pwrite(rproc_state_fd, "start", 5, 0);
-	if (ret < 4)
-		fprintf(stderr, "failed to update start state\n");
+	if (ret < 4) {
+		fprintf(stderr, "failed to update start state: %s\n",
+			strerror(errno));
+	}
 
 	return NULL;
 }
 
 int rproc_start()
 {
-	return pthread_create(&start_thread, NULL, do_rproc_start, NULL);
+	pthread_attr_t attr;
+
+	pthread_attr_init(&attr);
+	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+
+	return pthread_create(&start_thread, &attr, do_rproc_start, NULL);
 }
 
 static void *do_rproc_stop(void *unused __unused)
@@ -119,8 +200,10 @@
 	ssize_t ret;
 
 	ret = pwrite(rproc_state_fd, "stop", 4, 0);
-	if (ret < 4)
-		fprintf(stderr, "failed to update stop state\n");
+	if (ret < 4) {
+		fprintf(stderr, "failed to update stop state: %s\n",
+			strerror(errno));
+	}
 
 	ret = write(rproc_pipe[1], "Y", 1);
 	if (ret != 1) {
@@ -133,5 +216,10 @@
 
 int rproc_stop(void)
 {
-	return pthread_create(&stop_thread, NULL, do_rproc_stop, NULL);
+	pthread_attr_t attr;
+
+	pthread_attr_init(&attr);
+	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+
+	return pthread_create(&stop_thread, &attr, do_rproc_stop, NULL);
 }
diff --git a/qcom/rmtfs/storage.c b/qcom/rmtfs/storage.c
index c8e69ed..107b296 100644
--- a/qcom/rmtfs/storage.c
+++ b/qcom/rmtfs/storage.c
@@ -41,6 +41,7 @@
 	{ "/boot/modem_fs2", "modem_fs2", "modemst2" },
 	{ "/boot/modem_fsc", "modem_fsc", "fsc" },
 	{ "/boot/modem_fsg", "modem_fsg", "fsg" },
+	{ "/boot/modem_tunning", "modem_tunning", "tunning" },
 	{}
 };
 
@@ -150,8 +151,10 @@
 
 void storage_close(struct rmtfd *rmtfd)
 {
-	close(rmtfd->fd);
-	rmtfd->fd = -1;
+	if (rmtfd->fd >= 0) {
+		close(rmtfd->fd);
+		rmtfd->fd = -1;
+	}
 
 	free(rmtfd->shadow_buf);
 	rmtfd->shadow_buf = NULL;
@@ -188,10 +191,8 @@
 {
 	int i;
 
-	for (i = 0; i < MAX_CALLERS; i++) {
-		if (rmtfds[i].fd >= 0)
-			close(rmtfds[i].fd);
-	}
+	for (i = 0; i < MAX_CALLERS; i++)
+		storage_close(&rmtfds[i]);
 }
 
 ssize_t storage_pread(const struct rmtfd *rmtfd, void *buf, size_t nbyte, off_t offset)
@@ -201,7 +202,7 @@
 	if (!storage_read_only) {
 		n = pread(rmtfd->fd, buf, nbyte, offset);
 	} else {
-		n = MIN(nbyte, rmtfd->shadow_len - offset);
+		n = MIN((ssize_t)nbyte, (ssize_t)rmtfd->shadow_len - offset);
 		if (n > 0)
 			memcpy(buf, (char*)rmtfd->shadow_buf + offset, n);
 		else
@@ -244,6 +245,14 @@
 	return nbyte;
 }
 
+int storage_sync(struct rmtfd *rmtfd)
+{
+	if (storage_read_only)
+		return 0;
+	
+	return fdatasync(rmtfd->fd);
+}
+
 static int storage_populate_shadow_buf(struct rmtfd *rmtfd, const char *file)
 {
 	ssize_t len;
